namespace Scheduling.Api.Read.Models
{
    public class XunfeiHttpRequest
    {
        public string model { get; set; } = string.Empty;
        public List<Message> messages { get; set; } = new();
        public int max_tokens { get; set; } = 2048;
        public double temperature { get; set; } = 0.5;
        public int top_p { get; set; } = 1;
        public int repetition_penalty { get; set; } = 1;
    }

    public class Message
    {
        public string role { get; set; } = string.Empty;
        public string content { get; set; } = string.Empty;
    }

    public class XunfeiHttpResponse
    {
        public string id { get; set; } = string.Empty;
        public string @object { get; set; } = string.Empty;
        public long created { get; set; }
        public string model { get; set; } = string.Empty;
        public List<Choice> choices { get; set; } = new();
        public Usage usage { get; set; } = new();
    }

    public class Choice
    {
        public int index { get; set; }
        public Message message { get; set; } = new();
        public string finish_reason { get; set; } = string.Empty;
    }

    public class Usage
    {
        public int prompt_tokens { get; set; }
        public int completion_tokens { get; set; }
        public int total_tokens { get; set; }
    }

    public class XunfeiWebSocketRequest
    {
        public Header header { get; set; } = new();
        public Parameter parameter { get; set; } = new();
        public Payload payload { get; set; } = new();
    }

    public class Header
    {
        public string app_id { get; set; } = string.Empty;
        public string uid { get; set; } = string.Empty;
    }

    public class Parameter
    {
        public Chat chat { get; set; } = new();
    }

    public class Chat
    {
        public string domain { get; set; } = string.Empty;
        public double temperature { get; set; } = 0.5;
        public int max_tokens { get; set; } = 2048;
    }

    public class Payload
    {
        public Message message { get; set; } = new();
    }
}
